﻿using System;
using System.Data;
using System.Collections;
using CE.Database;

/// <summary>
/// Summary description for CarFileUploadDB
/// </summary>
namespace CE.Report
{
    public class CarFileUploadDB
    {
        public CarFileUploadDB()
        {
            //
            // TODO: Add constructor logic here
            //
        }

        public Int64 Insert(CarFileUpload carfileupload)
        {
            MyDatabase _db = new MyDatabase();
            Int64 _result = -1;
            string _spName = "sprocCarFileUploadDetailInsertUpdateSingleItem";

            SortedList _sPara = new SortedList();

            #region Parameter
            _sPara.Add("@CarId", carfileupload.CarId);
            _sPara.Add("@ProviderCompanyId", carfileupload.ProviderCompanyId);
            _sPara.Add("@InsuranceType", carfileupload.InsuranceType);
            _sPara.Add("@AgentId", carfileupload.AgentId);
            _sPara.Add("@DocRefNo", carfileupload.DocRefNo);
            _sPara.Add("@DocumentNo", carfileupload.DocumentNo);
            _sPara.Add("@FileName", carfileupload.FileName);
            _sPara.Add("@OriginalName", carfileupload.OriginalName);
            _sPara.Add("@Status", carfileupload.Status);
            #endregion

            _result = _db.ExecuteSP(_spName, _sPara);

            return _result;
        }

        public DataSet GetCarFileUploadList(Int64 CarId, Int64 ProviderCompanyId)
        {
            MyDatabase _db = new MyDatabase();
            string _spName = "[sprocCXTHCarFileUploadDetailSelectItemList]";

            SortedList _spara = new SortedList();
            _spara.Add("@CarId", CarId);
            _spara.Add("@ProviderCompanyId", ProviderCompanyId);

            DataSet _ds = _db.GetDataSet(_spName, _spara);

            return _ds;
        }

    }
}